using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class TurnStationMap : EntityTypeConfiguration<TurnStation>
	{
		public TurnStationMap()
		{
			// Primary Key
			this.HasKey(t => t.TurnStationID);

			// Properties
			this.Property(t => t.Status)
				.IsRequired()
				.HasMaxLength(20);
				
			this.Property(t => t.Reason)
				.HasMaxLength(500);
				
			this.Property(t => t.TruckNO)
				.HasMaxLength(20);
				
			// Table & Column Mappings
			this.ToTable("TurnStation");
			this.Property(t => t.TurnStationID).HasColumnName("TurnStationID");
			this.Property(t => t.WaybillNO).HasColumnName("WaybillNO");
			this.Property(t => t.Status).HasColumnName("Status");
			this.Property(t => t.ApplyStation).HasColumnName("ApplyStation");
			this.Property(t => t.ApplyBy).HasColumnName("ApplyBy");
			this.Property(t => t.TurnTime).HasColumnName("TurnTime");
			this.Property(t => t.SendBy).HasColumnName("SendBy");
			this.Property(t => t.SendTime).HasColumnName("SendTime");
			this.Property(t => t.RecipcorpStation).HasColumnName("RecipcorpStation");
			this.Property(t => t.RecipientBy).HasColumnName("RecipientBy");
			this.Property(t => t.RecipTime).HasColumnName("RecipTime");
			this.Property(t => t.ReasonType).HasColumnName("ReasonType");
			this.Property(t => t.Reason).HasColumnName("Reason");
			this.Property(t => t.CreatBy).HasColumnName("CreatBy");
			this.Property(t => t.CreatStation).HasColumnName("CreatStation");
			this.Property(t => t.Creattime).HasColumnName("Creattime");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
			this.Property(t => t.UpdateStation).HasColumnName("UpdateStation");
			this.Property(t => t.IsDeleted).HasColumnName("IsDeleted");
			this.Property(t => t.IsSyn).HasColumnName("IsSyn");
			this.Property(t => t.IsSendEmail).HasColumnName("IsSendEmail");
			this.Property(t => t.IsOk).HasColumnName("IsOk");
			this.Property(t => t.IsFast).HasColumnName("IsFast");
			this.Property(t => t.TranCompany).HasColumnName("TranCompany");
			this.Property(t => t.TranManID).HasColumnName("TranManID");
			this.Property(t => t.TruckNO).HasColumnName("TruckNO");
		}
	}
}

